Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two phase download #675

Merged
merged 39 commits into from
Feb 8, 2021
Merged

Two phase download #675

merged 39 commits into from
Feb 8, 2021

Conversation

Nurou
Copy link
Member

@Nurou Nurou commented Jan 13, 2021

No description provided.

@codecov
Copy link

codecov bot commented Jan 13, 2021

Codecov Report

Merging #675 (0529fec) into master (9edd898) will decrease coverage by 0.06%.
The diff coverage is 94.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #675      +/-   ##
==========================================
- Coverage   90.45%   90.39%   -0.07%     
==========================================
  Files          50       50              
  Lines        1750     1790      +40     
  Branches      227      236       +9     
==========================================
+ Hits         1583     1618      +35     
- Misses        163      167       +4     
- Partials        4        5       +1     
Impacted Files Coverage Δ
packages/backendv2/src/middleware/error_handler.ts 90.32% <0.00%> (ø)
packages/backendv2/tests/util.ts 100.00% <ø> (ø)
packages/backendv2/config/redis.ts 85.71% <80.00%> (+21.00%) ⬆️
...kages/backendv2/src/controllers/dashboard/index.ts 94.62% <95.77%> (-0.40%) ⬇️
...ckages/backendv2/src/controllers/dashboard/util.ts 89.79% <100.00%> (+3.68%) ⬆️
...ackages/backendv2/src/middleware/access_control.ts 92.30% <100.00%> (+21.71%) ⬆️
packages/backendv2/src/util/tools.ts 100.00% <100.00%> (ø)
packages/backendv2/src/models/quiz.ts 87.80% <0.00%> (-7.93%) ⬇️
packages/backendv2/src/models/course.ts 89.15% <0.00%> (-2.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9edd898...0529fec. Read the comment docs.

@Nurou Nurou changed the title Two phase download [WIP] Two phase download Jan 30, 2021
@Nurou Nurou linked an issue Jan 30, 2021 that may be closed by this pull request
@Nurou Nurou marked this pull request as ready for review February 1, 2021 10:21
)
ctx.body = stream
const { courseId } = ctx.request.body
const username = ctx.state.user.username
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx.state.user.id

const randomToken = JSON.stringify(
crypto.randomBytes(100).toString("hex"),
)
await redis.client.set(username, randomToken, "EX", 600)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key: download-token-${randomToken}, value: {valid: true}

@nygrenh nygrenh merged commit bd1e701 into master Feb 8, 2021
@nygrenh nygrenh deleted the two-phase-download branch February 8, 2021 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Two-phase download
2 participants